package jiubeirobot.com.robotshop.ui.fragment.shop;

import android.view.View;
import android.widget.Button;

import butterknife.BindView;
import butterknife.OnClick;
import jiubeirobot.com.robotshop.R;
import jiubeirobot.com.robotshop.base.BaseBean;
import jiubeirobot.com.robotshop.base.BaseFragment;
import jiubeirobot.com.robotshop.common.view.ConstionView;
import jiubeirobot.com.robotshop.common.view.FilterItemView;
import jiubeirobot.com.robotshop.ui.activity.shop.ShopBuyListActivity;

/**
 * 类描述    : 商品显示也展示筛选页的fragment
 * 创建人    : TheJoker丶豪  on 2017/9/6.
 * 修改人    :
 * 修改时间  :
 * 修改备注  :
 */
public class ShopFillterFragment  extends BaseFragment{

    @BindView(R.id.btn_reset)
    Button btnreset;
    @BindView(R.id.btn_submit)
    Button btnsubmit;
    ShopBuyListActivity shopBuyListActivity;
    @BindView(R.id.cv_year_filter)
    ConstionView svYear;//年份选择
    @BindView(R.id.cv_price_filter)
    ConstionView cvPrice;//价格选择
    @BindView(R.id.fiv_breed)
    FilterItemView fivbreed;

    @Override
    public int pageLayout() {
        return R.layout.fragment_shop_fillter;
    }

    @Override
    public void initTitle() {
        shopBuyListActivity = (ShopBuyListActivity) getActivity();
    }

    @Override
    public void initView() {
        //请求数据  适配筛选的数据
        svYear.setType("1");
        cvPrice.setType("0");

    }

    @Override
    public void onSuccess(BaseBean bean, int flag) {

    }
    @OnClick({R.id.btn_reset,R.id.btn_submit})
    public void onClick(View view){
        switch (view.getId()){
            case R.id.btn_reset:
                reset();
                shopBuyListActivity.reset();
                shopBuyListActivity.closeFilter();
                break;
            case R.id.btn_submit:
                shopBuyListActivity.closeFilter();
                break;
            default:
                break;
        }
    }
    /**
     * 点击重置按钮的时候所有view回归原样
     */
    public void reset(){

    }
}
